/*
 * Copyright 2012 ITC Tsinghua University. All Rights Reserved.
 */
package cn.edu.tsinghua.cic.ccss.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.forten.core.entity.rdb.hibernate.HibernateEntityWithCurrentTimeId;
import org.forten.utils.common.DateUtil;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">Duyi</a>
 * 
 * @since 2012-5-10
 */
@Entity
@Table(name = "THRS_GBGL_KKXXB")
@Cache(region = "courseCache", usage = CacheConcurrencyStrategy.READ_WRITE)
public class Course extends HibernateEntityWithCurrentTimeId {
	private static final long serialVersionUID = -7210454009480781802L;

	@Column(name = "KCH")
	private String num; // 课程号
	@Column(name = "KCM")
	private String name;// 课程名称
	@Column(name = "KCZT")
	private String state;// 课程状态
	@Column(name = "SKSJ")
	private Date teachTime;// 上课时间
	@Column(name = "SKSJMS")
	private String teachTimeDescription;// 上课时间描述
	@Column(name = "SKDD")
	private String classroom;// 上课地点
	@Column(name = "KCJJ")
	private String courseInfo;// 课程简介
	@Column(name = "KCLX")
	private String type;// 课程类型
	@Column(name = "SKJS_XM")
	private String teacherName;// 上课教师姓名
	@Column(name = "SKJS_JJ")
	private String teacherInfo;// 上课教师简介
	@Column(name = "BZR_XM")
	private String headTeacherName;// 班主任姓名
	@Column(name = "BZR_EMAIL")
	private String headTeacherEmail;// 班主任邮箱
	@Column(name = "BZR_SJ")
	private String headTeacherPhone;// 班主任手机号码
	@Column(name = "QTSM")
	private String otherInfo;// 其他说明
	@Column(name = "KRL")
	private int classCapacity;// 课容量
	@Column(name = "XKRS")
	private int classChosenNum;// 已选课人数
	@Column(name = "XF")
	private int credit;// 学时
	@Column(name = "XKKSSJ")
	private Date startTimeChoose;// 开始选课时间
	@Column(name = "XKJSSJ")
	private Date endTimeChoose;// 选课结束时间
	@Column(name = "IS_SEND_MESSAGE")
	private String sendMessageFlag;// 短信息是否已发送
	@Column(name = "IS_SEND_EMAIL")
	private String sendEmailFlag;// 邮件是否已方式
	@Column(name = "BZ")
	private String memo;// 备注
	@Column(name = "CJSJ")
	private Date createTime;

	public Course() {
		this.sendEmailFlag = "0";
		this.sendMessageFlag = "0";
		this.classCapacity = 0;
		this.state = "1";
		Date currentTime = DateUtil.currentTime();
		this.createTime = currentTime;
		String startStr = DateUtil.convertDateToString(currentTime,
				DateUtil.DATETIME_PATTERN);
		this.startTimeChoose = DateUtil.convertStringToDate(startStr,
				DateUtil.DATETIME_PATTERN);
	}

	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public Date getTeachTime() {
		return teachTime;
	}

	public void setTeachTime(Date teachTime) {
		this.teachTime = teachTime;
	}

	public String getTeachTimeDescription() {
		return teachTimeDescription;
	}

	public void setTeachTimeDescription(String teachTimeDescription) {
		this.teachTimeDescription = teachTimeDescription;
	}

	public String getClassroom() {
		return classroom;
	}

	public void setClassroom(String classroom) {
		this.classroom = classroom;
	}

	public String getCourseInfo() {
		return courseInfo;
	}

	public void setCourseInfo(String courseInfo) {
		this.courseInfo = courseInfo;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTeacherName() {
		return teacherName;
	}

	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}

	public String getTeacherInfo() {
		return teacherInfo;
	}

	public void setTeacherInfo(String teacherInfo) {
		this.teacherInfo = teacherInfo;
	}

	public String getHeadTeacherName() {
		return headTeacherName;
	}

	public void setHeadTeacherName(String headTeacherName) {
		this.headTeacherName = headTeacherName;
	}

	public String getHeadTeacherEmail() {
		return headTeacherEmail;
	}

	public void setHeadTeacherEmail(String headTeacherEmail) {
		this.headTeacherEmail = headTeacherEmail;
	}

	public String getHeadTeacherPhone() {
		return headTeacherPhone;
	}

	public void setHeadTeacherPhone(String headTeacherPhone) {
		this.headTeacherPhone = headTeacherPhone;
	}

	public String getOtherInfo() {
		return otherInfo;
	}

	public void setOtherInfo(String otherInfo) {
		this.otherInfo = otherInfo;
	}

	public int getClassCapacity() {
		return classCapacity;
	}

	public void setClassCapacity(int classCapacity) {
		this.classCapacity = classCapacity;
	}

	public int getClassChosenNum() {
		return classChosenNum;
	}

	public void setClassChosenNum(int classChosenNum) {
		this.classChosenNum = classChosenNum;
	}

	public int getCredit() {
		return credit;
	}

	public void setCredit(int credit) {
		this.credit = credit;
	}

	public Date getStartTimeChoose() {
		return startTimeChoose;
	}

	public void setStartTimeChoose(Date startTimeChoose) {
		this.startTimeChoose = startTimeChoose;
	}

	public Date getEndTimeChoose() {
		return endTimeChoose;
	}

	public void setEndTimeChoose(Date endTimeChoose) {
		this.endTimeChoose = endTimeChoose;
	}

	public String getSendMessageFlag() {
		return sendMessageFlag;
	}

	public void setSendMessageFlag(String sendMessageFlag) {
		this.sendMessageFlag = sendMessageFlag;
	}

	public String getSendEmailFlag() {
		return sendEmailFlag;
	}

	public void setSendEmailFlag(String sendEmailFlag) {
		this.sendEmailFlag = sendEmailFlag;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Date getCreateTime() {
		return createTime;
	}
}
